#ifndef _CAN_H_
#define _CAN_H_

#include "driver/twai.h"

typedef enum
{
  CAN_TWAI=0,
  CAN_MCP2515,
}CANx_t;

typedef enum
{
  CAN_1000K=0,
  CAN_500K,
  CAN_250K,
  CAN_125K,
}CAN_SPEED_t;

uint8_t TWAI_CAN_Init(CAN_SPEED_t speed);
void TWAI_CAN_RECOVERY_TASK(void *arg);
uint8_t TWAI_CAN_STATUS(void);
esp_err_t TWAI_CAN_TX(twai_message_t *msg);
esp_err_t TWAI_CAN_RX(twai_message_t *msg);


#endif
